#include "XMPPConnection.h"
#include <iostream>

class consoleMessageListener : public MessageListener {
public:
	void processMessage(Chat * chat, Message * message) {
		std::cout<< "Received message: " << message.toXML();
	}
};

int
main()
{
	ConnectionConfiguration * connectionConfig = new ConnectionConfiguration("talk.google.com",5222,"gmail.com");
	XMPPConnection * connection = new XMPPConnection(connectionConfig);
	connection->connect();
	connection->login("sui.dapeng", "password");
	ChatManager * chatmanager = connection->getChatManager();
	MessageListener * messageListener = new consoleMessageListener();
	Chat * newChat = chatmanager->createChat("racingtom@gmail.com", messageListener);
}
